package com.jindy.module.drawBillDetail.service.impl;

import java.util.List;
import com.jindy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jindy.module.drawBillDetail.mapper.DrawBillDetailMapper;
import com.jindy.module.drawBillDetail.domain.DrawBillDetail;
import com.jindy.module.drawBillDetail.service.IDrawBillDetailService;

/**
 * 开票申请明细Service业务层处理
 * 
 * @author jindy
 * @date 2023-05-19
 */
@Service
public class DrawBillDetailServiceImpl implements IDrawBillDetailService 
{
    @Autowired
    private DrawBillDetailMapper drawBillDetailMapper;

    /**
     * 查询开票申请明细
     * 
     * @param id 开票申请明细主键
     * @return 开票申请明细
     */
    @Override
    public DrawBillDetail selectDrawBillDetailById(Long id)
    {
        return drawBillDetailMapper.selectDrawBillDetailById(id);
    }

    /**
     * 查询开票申请明细列表
     * 
     * @param drawBillDetail 开票申请明细
     * @return 开票申请明细
     */
    @Override
    public List<DrawBillDetail> selectDrawBillDetailList(DrawBillDetail drawBillDetail)
    {
        return drawBillDetailMapper.selectDrawBillDetailList(drawBillDetail);
    }

    /**
     * 新增开票申请明细
     * 
     * @param drawBillDetail 开票申请明细
     * @return 结果
     */
    @Override
    public int insertDrawBillDetail(DrawBillDetail drawBillDetail)
    {
        drawBillDetail.setCreateTime(DateUtils.getNowDate());
        return drawBillDetailMapper.insertDrawBillDetail(drawBillDetail);
    }

    /**
     * 修改开票申请明细
     * 
     * @param drawBillDetail 开票申请明细
     * @return 结果
     */
    @Override
    public int updateDrawBillDetail(DrawBillDetail drawBillDetail)
    {
        drawBillDetail.setUpdateTime(DateUtils.getNowDate());
        return drawBillDetailMapper.updateDrawBillDetail(drawBillDetail);
    }

    /**
     * 批量删除开票申请明细
     * 
     * @param ids 需要删除的开票申请明细主键
     * @return 结果
     */
    @Override
    public int deleteDrawBillDetailByIds(Long[] ids)
    {
        return drawBillDetailMapper.deleteDrawBillDetailByIds(ids);
    }

    /**
     * 删除开票申请明细信息
     * 
     * @param id 开票申请明细主键
     * @return 结果
     */
    @Override
    public int deleteDrawBillDetailById(Long id)
    {
        return drawBillDetailMapper.deleteDrawBillDetailById(id);
    }
}
